package com.PAT.UnSatisfying;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/12/27/14:09
 * @Description: 差5
 * @Target:
 */
public class 数字加密 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String ss = in.nextLine();

        String[] s1 = ss.split(" ");
        int start = s1[0].length()>=s1[1].length()?s1[0].length()-s1[1].length():s1[1].length()-s1[0].length();
        if (s1[0].length()>=s1[1].length()){
            for (int i = 0; i < s1[1].length(); i++) {
                String sss = dealWith(i,s1[0].charAt(i),s1[1].charAt(i));
                System.out.print(sss);
            }
            for (int i = s1[1].length(); i < s1[0].length(); i++) {
                System.out.print(dealWith(i,s1[0].charAt(i),'0'));
            }
        }else {
            for (int i = 0; i < start; i++) {
                System.out.print(s1[1].charAt(i));
            }
            for (int i = start; i < s1[1].length(); i++) {

                String sss = dealWith((i-start),s1[0].charAt(i-start),s1[1].charAt(i));
                System.out.print(sss);
            }
        }




    }

    public static String dealWith(int index,char s1,char s2){
        index+=1;
        String x = "";
        if (index%2!=0){
            int sum = (s1-'0')+(s2-'0');
            sum=sum%13;
            if (sum==10){
                x="J";
            }else if (sum==11){
                x="Q";
            }else if (sum==12){
                x="K";
            }else {
                x=sum+"";
            }
        }else {
            int cha = (s2-'0')-(s1-'0');
            if (cha<0){
                cha += 10;
            }
            x=cha+"";
        }

        return x;
    }
}
